Ext.define('TS.view.dilema.QuoteGrid' , {
	extend: 'TS.lib.Grid',
	alias : 'widget.dilemapointquotegrid',
	//tbar:Factory.toolbar.search(),
	tbar:[
		Factory.btn.ico('search',Factory.toolbar._.go,{
			fix:'dilemapointquotegrid',
			flds:{
				hidden:['argument']
			}
		}),
		
		{xtype:'hidden',name:'argument',names:['dilema_point_id'],getVal:function(){
			return Util.fldVal('dilema_point->id');
		}},
		
		Factory.btn.ico('add',
			function(){
				var fix = 'dilemapointquote';
				Factory.winForm(fix,null,'simple');
				Util.fldVal(fix+'->#dilema_point_id','dilema_point->id');
			}
		)
	
	],
	frame:false,
	store: 'DilemaPointQuote',
	listeners:{
		'itemdblclick':function(){
			
		}
	},
	columns: [
	 	{xtype: 'rownumberer'},{
			header:'ID',
			hidden:true,
			dataIndex:'dilema_point_quote_id'
		},{
			header:'Cytat',
			sortable:true,
			dataIndex:'book_id',
			renderer:function(v,index,rec){
				var d = rec.data;
				return Ext.String.format(
					'<b>{0}</b><br/>' +
					'<i>rozdział {1}</i><br/>' +
					'<i>wersy {2}-{3}</i>',				
						Factory.rend.loose_dict(d.book_id,Dict.book),
						Factory.rend.loose_dict(d.chapter_id,Dict.chapter),
						d.start_verse_number,	d.end_verse_number
				);
			}
		},{
			header:'Biblia Tysiąclecia',
			renderer:Factory.rend.div,
			dataIndex:'bible_1_text'
		},{
			header:'King James Version',
			renderer:Factory.rend.div,
			dataIndex:'bible_3_text'
		}
	]
});